
<?php
  /*
    Copyright 2010 Persistent Systems Limited

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
   */

    /**
    * This code was generated by the tool 'PHPDataSvcUtil.php'.
    * Runtime Version:1.0
    *
    * Changes to this file may cause incorrect behavior and will be lost if
    * the code is regenerated.
    */

    require_once 'Context/ObjectContext.php';
    /**
    * Defines default OData Service URL for this proxy class
    */
    define("DEFAULT_ODATA_SERVICE_URL", "http://localhost:13985/ACSNorthwindDataService.svc");
    
   /**
    * @class:Categories
    * @type:EntityType
    * @key:CategoryID
    */
    class Categories extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $CategoryID;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:15
        * @FixedLength:false
        */
        public $CategoryName;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:Max
        * @FixedLength:false
        */
        public $Description;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.Binary
        */
        public $Picture;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Products_Categories
        * @FromRole:Categories
        * @ToRole:Products
        */
        public $Products;
    

       /**
        * Function to create an instance of Categories
        * @param Edm.Int32 $CategoryID
        * @param Edm.String $CategoryName
        */
        public static function CreateCategories(
            $CategoryID, 
            $CategoryName)
        {   
            $Categories = new Categories();
            $Categories->CategoryID = $CategoryID;
            $Categories->CategoryName = $CategoryName;
            return $Categories;
        }

       /**
        * Constructor for Categories
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Products'] = 'Products';
            $this->_entityKey[] = 'CategoryID';
            $this->Products = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:CustomerDemographics
    * @type:EntityType
    * @key:CustomerTypeID
    */
    class CustomerDemographics extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:Max
        * @FixedLength:false
        */
        public $CustomerDesc;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:10
        * @FixedLength:true
        */
        public $CustomerTypeID;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:CustomerCustomerDemo
        * @FromRole:CustomerDemographics
        * @ToRole:Customers
        */
        public $Customers;
    

       /**
        * Function to create an instance of CustomerDemographics
        * @param Edm.String $CustomerTypeID
        */
        public static function CreateCustomerDemographics(
            $CustomerTypeID)
        {   
            $CustomerDemographics = new CustomerDemographics();
            $CustomerDemographics->CustomerTypeID = $CustomerTypeID;
            return $CustomerDemographics;
        }

       /**
        * Constructor for CustomerDemographics
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Customers'] = 'Customers';
            $this->_entityKey[] = 'CustomerTypeID';
            $this->Customers = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:Customers
    * @type:EntityType
    * @key:CustomerID
    */
    class Customers extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:60
        * @FixedLength:false
        */
        public $Address;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:15
        * @FixedLength:false
        */
        public $City;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:40
        * @FixedLength:false
        */
        public $CompanyName;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:30
        * @FixedLength:false
        */
        public $ContactName;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:30
        * @FixedLength:false
        */
        public $ContactTitle;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:15
        * @FixedLength:false
        */
        public $Country;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:5
        * @FixedLength:true
        */
        public $CustomerID;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:24
        * @FixedLength:false
        */
        public $Fax;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:24
        * @FixedLength:false
        */
        public $Phone;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:10
        * @FixedLength:false
        */
        public $PostalCode;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:15
        * @FixedLength:false
        */
        public $Region;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Orders_Customers
        * @FromRole:Customers
        * @ToRole:Orders
        */
        public $Orders;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:CustomerCustomerDemo
        * @FromRole:Customers
        * @ToRole:CustomerDemographics
        */
        public $CustomerDemographics;
    

       /**
        * Function to create an instance of Customers
        * @param Edm.String $CompanyName
        * @param Edm.String $CustomerID
        */
        public static function CreateCustomers(
            $CompanyName, 
            $CustomerID)
        {   
            $Customers = new Customers();
            $Customers->CompanyName = $CompanyName;
            $Customers->CustomerID = $CustomerID;
            return $Customers;
        }

       /**
        * Constructor for Customers
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Orders'] = 'Orders';
            $this->_entityMap['CustomerDemographics'] = 'CustomerDemographics';
            $this->_entityKey[] = 'CustomerID';
            $this->Orders = array();
            $this->CustomerDemographics = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:Employees
    * @type:EntityType
    * @key:EmployeeID
    */
    class Employees extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:60
        * @FixedLength:false
        */
        public $Address;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.DateTime
        */
        public $BirthDate;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:15
        * @FixedLength:false
        */
        public $City;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:15
        * @FixedLength:false
        */
        public $Country;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $EmployeeID;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:4
        * @FixedLength:false
        */
        public $Extension;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:10
        * @FixedLength:false
        */
        public $FirstName;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.DateTime
        */
        public $HireDate;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:24
        * @FixedLength:false
        */
        public $HomePhone;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:20
        * @FixedLength:false
        */
        public $LastName;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:Max
        * @FixedLength:false
        */
        public $Notes;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.Binary
        */
        public $Photo;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:255
        * @FixedLength:false
        */
        public $PhotoPath;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:10
        * @FixedLength:false
        */
        public $PostalCode;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:15
        * @FixedLength:false
        */
        public $Region;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:30
        * @FixedLength:false
        */
        public $Title;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:25
        * @FixedLength:false
        */
        public $TitleOfCourtesy;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Employees_Employees
        * @FromRole:Employees
        * @ToRole:Employees1
        */
        public $Employees1;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Employees_Employees
        * @FromRole:Employees1
        * @ToRole:Employees
        */
        public $Employees2;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Orders_Employees
        * @FromRole:Employees
        * @ToRole:Orders
        */
        public $Orders;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:EmployeeTerritories
        * @FromRole:Employees
        * @ToRole:Territories
        */
        public $Territories;
    

       /**
        * Function to create an instance of Employees
        * @param Edm.Int32 $EmployeeID
        * @param Edm.String $FirstName
        * @param Edm.String $LastName
        */
        public static function CreateEmployees(
            $EmployeeID, 
            $FirstName, 
            $LastName)
        {   
            $Employees = new Employees();
            $Employees->EmployeeID = $EmployeeID;
            $Employees->FirstName = $FirstName;
            $Employees->LastName = $LastName;
            return $Employees;
        }

       /**
        * Constructor for Employees
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Employees1'] = 'Employees1';
            $this->_entityMap['Employees2'] = 'Employees';
            $this->_entityMap['Orders'] = 'Orders';
            $this->_entityMap['Territories'] = 'Territories';
            $this->_entityKey[] = 'EmployeeID';
            $this->Employees1 = array();
            $this->Employees2 = array();
            $this->Orders = array();
            $this->Territories = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:Order_Details
    * @type:EntityType
    * @key:OrderID
    * @key:ProductID
    */
    class Order_Details extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Single
        */
        public $Discount;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $OrderID;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $ProductID;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int16
        */
        public $Quantity;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Decimal
        */
        public $UnitPrice;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Order_Details_Orders
        * @FromRole:Order_Details
        * @ToRole:Orders
        */
        public $Orders;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Order_Details_Products
        * @FromRole:Order_Details
        * @ToRole:Products
        */
        public $Products;
    

       /**
        * Function to create an instance of Order_Details
        * @param Edm.Single $Discount
        * @param Edm.Int32 $OrderID
        * @param Edm.Int32 $ProductID
        * @param Edm.Int16 $Quantity
        * @param Edm.Decimal $UnitPrice
        */
        public static function CreateOrder_Details(
            $Discount, 
            $OrderID, 
            $ProductID, 
            $Quantity, 
            $UnitPrice)
        {   
            $Order_Details = new Order_Details();
            $Order_Details->Discount = $Discount;
            $Order_Details->OrderID = $OrderID;
            $Order_Details->ProductID = $ProductID;
            $Order_Details->Quantity = $Quantity;
            $Order_Details->UnitPrice = $UnitPrice;
            return $Order_Details;
        }

       /**
        * Constructor for Order_Details
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Orders'] = 'Orders';
            $this->_entityMap['Products'] = 'Products';
            $this->_entityKey[] = 'OrderID';
            $this->_entityKey[] = 'ProductID';
            $this->Orders = array();
            $this->Products = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:Orders
    * @type:EntityType
    * @key:OrderID
    */
    class Orders extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.Decimal
        */
        public $Freight;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.DateTime
        */
        public $OrderDate;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $OrderID;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.DateTime
        */
        public $RequiredDate;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:60
        * @FixedLength:false
        */
        public $ShipAddress;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:15
        * @FixedLength:false
        */
        public $ShipCity;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:15
        * @FixedLength:false
        */
        public $ShipCountry;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:40
        * @FixedLength:false
        */
        public $ShipName;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.DateTime
        */
        public $ShippedDate;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:10
        * @FixedLength:false
        */
        public $ShipPostalCode;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:15
        * @FixedLength:false
        */
        public $ShipRegion;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Orders_Customers
        * @FromRole:Orders
        * @ToRole:Customers
        */
        public $Customers;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Orders_Employees
        * @FromRole:Orders
        * @ToRole:Employees
        */
        public $Employees;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Order_Details_Orders
        * @FromRole:Orders
        * @ToRole:Order_Details
        */
        public $Order_Details;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Orders_Shippers
        * @FromRole:Orders
        * @ToRole:Shippers
        */
        public $Shippers;
    

       /**
        * Function to create an instance of Orders
        * @param Edm.Int32 $OrderID
        */
        public static function CreateOrders(
            $OrderID)
        {   
            $Orders = new Orders();
            $Orders->OrderID = $OrderID;
            return $Orders;
        }

       /**
        * Constructor for Orders
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Customers'] = 'Customers';
            $this->_entityMap['Employees'] = 'Employees';
            $this->_entityMap['Order_Details'] = 'Order_Details';
            $this->_entityMap['Shippers'] = 'Shippers';
            $this->_entityKey[] = 'OrderID';
            $this->Customers = array();
            $this->Employees = array();
            $this->Order_Details = array();
            $this->Shippers = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:Products
    * @type:EntityType
    * @key:ProductID
    */
    class Products extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Boolean
        */
        public $Discontinued;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $ProductID;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:40
        * @FixedLength:false
        */
        public $ProductName;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:20
        * @FixedLength:false
        */
        public $QuantityPerUnit;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.Int16
        */
        public $ReorderLevel;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.Decimal
        */
        public $UnitPrice;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.Int16
        */
        public $UnitsInStock;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.Int16
        */
        public $UnitsOnOrder;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Products_Categories
        * @FromRole:Products
        * @ToRole:Categories
        */
        public $Categories;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Order_Details_Products
        * @FromRole:Products
        * @ToRole:Order_Details
        */
        public $Order_Details;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Products_Suppliers
        * @FromRole:Products
        * @ToRole:Suppliers
        */
        public $Suppliers;
    

       /**
        * Function to create an instance of Products
        * @param Edm.Boolean $Discontinued
        * @param Edm.Int32 $ProductID
        * @param Edm.String $ProductName
        */
        public static function CreateProducts(
            $Discontinued, 
            $ProductID, 
            $ProductName)
        {   
            $Products = new Products();
            $Products->Discontinued = $Discontinued;
            $Products->ProductID = $ProductID;
            $Products->ProductName = $ProductName;
            return $Products;
        }

       /**
        * Constructor for Products
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Categories'] = 'Categories';
            $this->_entityMap['Order_Details'] = 'Order_Details';
            $this->_entityMap['Suppliers'] = 'Suppliers';
            $this->_entityKey[] = 'ProductID';
            $this->Categories = array();
            $this->Order_Details = array();
            $this->Suppliers = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:Region
    * @type:EntityType
    * @key:RegionID
    */
    class Region extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:50
        * @FixedLength:true
        */
        public $RegionDescription;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $RegionID;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Territories_Region
        * @FromRole:Region
        * @ToRole:Territories
        */
        public $Territories;
    

       /**
        * Function to create an instance of Region
        * @param Edm.String $RegionDescription
        * @param Edm.Int32 $RegionID
        */
        public static function CreateRegion(
            $RegionDescription, 
            $RegionID)
        {   
            $Region = new Region();
            $Region->RegionDescription = $RegionDescription;
            $Region->RegionID = $RegionID;
            return $Region;
        }

       /**
        * Constructor for Region
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Territories'] = 'Territories';
            $this->_entityKey[] = 'RegionID';
            $this->Territories = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:Shippers
    * @type:EntityType
    * @key:ShipperID
    */
    class Shippers extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:40
        * @FixedLength:false
        */
        public $CompanyName;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:24
        * @FixedLength:false
        */
        public $Phone;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $ShipperID;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Orders_Shippers
        * @FromRole:Shippers
        * @ToRole:Orders
        */
        public $Orders;
    

       /**
        * Function to create an instance of Shippers
        * @param Edm.String $CompanyName
        * @param Edm.Int32 $ShipperID
        */
        public static function CreateShippers(
            $CompanyName, 
            $ShipperID)
        {   
            $Shippers = new Shippers();
            $Shippers->CompanyName = $CompanyName;
            $Shippers->ShipperID = $ShipperID;
            return $Shippers;
        }

       /**
        * Constructor for Shippers
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Orders'] = 'Orders';
            $this->_entityKey[] = 'ShipperID';
            $this->Orders = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:Suppliers
    * @type:EntityType
    * @key:SupplierID
    */
    class Suppliers extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:60
        * @FixedLength:false
        */
        public $Address;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:15
        * @FixedLength:false
        */
        public $City;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:40
        * @FixedLength:false
        */
        public $CompanyName;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:30
        * @FixedLength:false
        */
        public $ContactName;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:30
        * @FixedLength:false
        */
        public $ContactTitle;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:15
        * @FixedLength:false
        */
        public $Country;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:24
        * @FixedLength:false
        */
        public $Fax;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:Max
        * @FixedLength:false
        */
        public $HomePage;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:24
        * @FixedLength:false
        */
        public $Phone;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:10
        * @FixedLength:false
        */
        public $PostalCode;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:15
        * @FixedLength:false
        */
        public $Region;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $SupplierID;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Products_Suppliers
        * @FromRole:Suppliers
        * @ToRole:Products
        */
        public $Products;
    

       /**
        * Function to create an instance of Suppliers
        * @param Edm.String $CompanyName
        * @param Edm.Int32 $SupplierID
        */
        public static function CreateSuppliers(
            $CompanyName, 
            $SupplierID)
        {   
            $Suppliers = new Suppliers();
            $Suppliers->CompanyName = $CompanyName;
            $Suppliers->SupplierID = $SupplierID;
            return $Suppliers;
        }

       /**
        * Constructor for Suppliers
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Products'] = 'Products';
            $this->_entityKey[] = 'SupplierID';
            $this->Products = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:Territories
    * @type:EntityType
    * @key:TerritoryID
    */
    class Territories extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:50
        * @FixedLength:true
        */
        public $TerritoryDescription;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:20
        * @FixedLength:false
        */
        public $TerritoryID;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Territories_Region
        * @FromRole:Territories
        * @ToRole:Region
        */
        public $Region;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:EmployeeTerritories
        * @FromRole:Territories
        * @ToRole:Employees
        */
        public $Employees;
    

       /**
        * Function to create an instance of Territories
        * @param Edm.String $TerritoryDescription
        * @param Edm.String $TerritoryID
        */
        public static function CreateTerritories(
            $TerritoryDescription, 
            $TerritoryID)
        {   
            $Territories = new Territories();
            $Territories->TerritoryDescription = $TerritoryDescription;
            $Territories->TerritoryID = $TerritoryID;
            return $Territories;
        }

       /**
        * Constructor for Territories
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Region'] = 'Region';
            $this->_entityMap['Employees'] = 'Employees';
            $this->_entityKey[] = 'TerritoryID';
            $this->Region = array();
            $this->Employees = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * Container class NorthwindEntities1, Namespace: NorthwindModel1
    */
    class NorthwindEntities1 extends ObjectContext
    {
    
        protected $_Categories;
        protected $_CustomerDemographics;
        protected $_Customers;
        protected $_Employees;
        protected $_Order_Details;
        protected $_Orders;
        protected $_Products;
        protected $_Region;
        protected $_Shippers;
        protected $_Suppliers;
        protected $_Territories;
        
       /**
        * The constructor for NorthwindEntities1 accepting service URI
        */
        public function __construct($uri = "")
        {
            if(strlen($uri) == 0)
            {
                $uri = DEFAULT_ODATA_SERVICE_URL;
            }

            if (Utility::reverseFind($uri, '/') != strlen($uri) - 1)
            {
                $uri = $uri . '/';
            }

            $this->_baseURI = $uri;
            parent::__construct($this->_baseURI);
            $this->_entities = array(
                                "Categories",
                                "CustomerDemographics",
                                "Customers",
                                "Employees",
                                "Order_Details",
                                "Orders",
                                "Products",
                                "Region",
                                "Shippers",
                                "Suppliers",
                                "Territories");
            $this->_entitySet2Type = array(
                                            "categories" => "Categories", 
                                            "customerdemographics" => "CustomerDemographics", 
                                            "customers" => "Customers", 
                                            "employees" => "Employees", 
                                            "order_details" => "Order_Details", 
                                            "orders" => "Orders", 
                                            "products" => "Products", 
                                            "region" => "Region", 
                                            "shippers" => "Shippers", 
                                            "suppliers" => "Suppliers", 
                                            "territories" => "Territories");
            $this->_entityType2Set = array(
                                            "categories" => "Categories", 
                                            "customerdemographics" => "CustomerDemographics", 
                                            "customers" => "Customers", 
                                            "employees" => "Employees", 
                                            "order_details" => "Order_Details", 
                                            "orders" => "Orders", 
                                            "products" => "Products", 
                                            "region" => "Region", 
                                            "shippers" => "Shippers", 
                                            "suppliers" => "Suppliers", 
                                            "territories" => "Territories");

            $this->_association = array(
                                         "FK_Products_Categories" => array(
                                                                         "Categories" => "0..1" ,
                                                                         "Products" => "*" ), 
                                         "FK_Orders_Customers" => array(
                                                                         "Customers" => "0..1" ,
                                                                         "Orders" => "*" ), 
                                         "FK_Employees_Employees" => array(
                                                                         "Employees" => "0..1" ,
                                                                         "Employees1" => "*" ), 
                                         "FK_Orders_Employees" => array(
                                                                         "Employees" => "0..1" ,
                                                                         "Orders" => "*" ), 
                                         "FK_Order_Details_Orders" => array(
                                                                         "Orders" => "1" ,
                                                                         "Order_Details" => "*" ), 
                                         "FK_Order_Details_Products" => array(
                                                                         "Products" => "1" ,
                                                                         "Order_Details" => "*" ), 
                                         "FK_Orders_Shippers" => array(
                                                                         "Shippers" => "0..1" ,
                                                                         "Orders" => "*" ), 
                                         "FK_Products_Suppliers" => array(
                                                                         "Suppliers" => "0..1" ,
                                                                         "Products" => "*" ), 
                                         "FK_Territories_Region" => array(
                                                                         "Region" => "1" ,
                                                                         "Territories" => "*" ), 
                                         "CustomerCustomerDemo" => array(
                                                                         "CustomerDemographics" => "*" ,
                                                                         "Customers" => "*" ), 
                                         "EmployeeTerritories" => array(
                                                                         "Employees" => "*" ,
                                                                         "Territories" => "*" ));

    
            $this->_Categories = new DataServiceQuery('/'.'Categories', $this);
            $this->_CustomerDemographics = new DataServiceQuery('/'.'CustomerDemographics', $this);
            $this->_Customers = new DataServiceQuery('/'.'Customers', $this);
            $this->_Employees = new DataServiceQuery('/'.'Employees', $this);
            $this->_Order_Details = new DataServiceQuery('/'.'Order_Details', $this);
            $this->_Orders = new DataServiceQuery('/'.'Orders', $this);
            $this->_Products = new DataServiceQuery('/'.'Products', $this);
            $this->_Region = new DataServiceQuery('/'.'Region', $this);
            $this->_Shippers = new DataServiceQuery('/'.'Shippers', $this);
            $this->_Suppliers = new DataServiceQuery('/'.'Suppliers', $this);
            $this->_Territories = new DataServiceQuery('/'.'Territories', $this);

        }

    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Categories
         * @return DataServiceQuery
         */
        public function Categories()
        {
            $this->_Categories->ClearAllOptions();
            return $this->_Categories;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset CustomerDemographics
         * @return DataServiceQuery
         */
        public function CustomerDemographics()
        {
            $this->_CustomerDemographics->ClearAllOptions();
            return $this->_CustomerDemographics;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Customers
         * @return DataServiceQuery
         */
        public function Customers()
        {
            $this->_Customers->ClearAllOptions();
            return $this->_Customers;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Employees
         * @return DataServiceQuery
         */
        public function Employees()
        {
            $this->_Employees->ClearAllOptions();
            return $this->_Employees;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Order_Details
         * @return DataServiceQuery
         */
        public function Order_Details()
        {
            $this->_Order_Details->ClearAllOptions();
            return $this->_Order_Details;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Orders
         * @return DataServiceQuery
         */
        public function Orders()
        {
            $this->_Orders->ClearAllOptions();
            return $this->_Orders;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Products
         * @return DataServiceQuery
         */
        public function Products()
        {
            $this->_Products->ClearAllOptions();
            return $this->_Products;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Region
         * @return DataServiceQuery
         */
        public function Region()
        {
            $this->_Region->ClearAllOptions();
            return $this->_Region;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Shippers
         * @return DataServiceQuery
         */
        public function Shippers()
        {
            $this->_Shippers->ClearAllOptions();
            return $this->_Shippers;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Suppliers
         * @return DataServiceQuery
         */
        public function Suppliers()
        {
            $this->_Suppliers->ClearAllOptions();
            return $this->_Suppliers;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Territories
         * @return DataServiceQuery
         */
        public function Territories()
        {
            $this->_Territories->ClearAllOptions();
            return $this->_Territories;
        }
    
       /**
        * Functions for adding object to the entityset/collection
        */
    
       /**
        * Add Categories
        * @param Categories $object
        */
      public function AddToCategories($object)
        {
            return parent::AddObject('Categories', $object);
        }
    
       /**
        * Add CustomerDemographics
        * @param CustomerDemographics $object
        */
      public function AddToCustomerDemographics($object)
        {
            return parent::AddObject('CustomerDemographics', $object);
        }
    
       /**
        * Add Customers
        * @param Customers $object
        */
      public function AddToCustomers($object)
        {
            return parent::AddObject('Customers', $object);
        }
    
       /**
        * Add Employees
        * @param Employees $object
        */
      public function AddToEmployees($object)
        {
            return parent::AddObject('Employees', $object);
        }
    
       /**
        * Add Order_Details
        * @param Order_Details $object
        */
      public function AddToOrder_Details($object)
        {
            return parent::AddObject('Order_Details', $object);
        }
    
       /**
        * Add Orders
        * @param Orders $object
        */
      public function AddToOrders($object)
        {
            return parent::AddObject('Orders', $object);
        }
    
       /**
        * Add Products
        * @param Products $object
        */
      public function AddToProducts($object)
        {
            return parent::AddObject('Products', $object);
        }
    
       /**
        * Add Region
        * @param Region $object
        */
      public function AddToRegion($object)
        {
            return parent::AddObject('Region', $object);
        }
    
       /**
        * Add Shippers
        * @param Shippers $object
        */
      public function AddToShippers($object)
        {
            return parent::AddObject('Shippers', $object);
        }
    
       /**
        * Add Suppliers
        * @param Suppliers $object
        */
      public function AddToSuppliers($object)
        {
            return parent::AddObject('Suppliers', $object);
        }
    
       /**
        * Add Territories
        * @param Territories $object
        */
      public function AddToTerritories($object)
        {
            return parent::AddObject('Territories', $object);
        }
    

       /**
        * This function returns the entities.
        */
        public function getEntities()
        {
            return $this->_entities;
        }
    }
  
?>
  